Unit Setup
The Unit Setup dialog lets you view all existing units in the project with the conversion factor for each, and allows addition and editing of user-defined units.
Click image to expand or minimize.
- Load Load a Units file (see PetroVR Files).
- Save: Save the current Units file.
- Save As: Save the current Units file with a new name.
- Reset to Default System Units: Remove all user-defined units not used in the currently open project. This option also resets the dollar/euro conversion factor to the default (1 USD = 0.68 EUR).
Using the Units File
A PetroVR project does not require a units file to work by itself, since all system units are fixed and do not need to be saved separately, and changes made to user-defined units (or to the conversion factor of the Euro unit - see below) are saved internally in the project, if those units are actually used in it. In order to share unit definitions between projects and with other users, you need to save your changes to a Units file. If you use a variety of unit files (other than the default units.csr file), each session and new project will refer to the last units file used, unless you use the option to Detach the units file in the Files tab.
Units are arranged by Type (list on the left), and use the following color code:
- Aqua, bold: System and FML Constant Unit - unit in which constants will be interpreted when added to an FML function without specifying a unit.
- Bold: Default unit (set up in the Preferences tab) for variables of this type in newly created objects.
- Black: System unit.
- User-defined unit.
When you change the conversion rate of a user-defined unit and there already exist variables that use that unit, PetroVR assumes that you wish to keep the value displayed in the selected unit before the change, and internally recalculates the value in the base unit.
The Euro (€) is treated as a a special system unit whose conversion (exchange) rate can be modified, as if it was a user-defined unit.
To create a money-type unit for Yen, enter the string "Yen" and it will be replaced by "¥".
PetroVR assumes standard conditions of pressure (14.696 psi) and temperature (60 F) for all volumes of gas. This means that in PetroVR 1 scf represents the amount of gas in standard conditions of pressure and temperature that occupies 1 cubic feet. Any calculation aimed at computing the number of moles of gas that is based on these volumes should consequently use standard values of pressure and temperature. This is not affected by the Standard Pressure and Standard Temperature defined in the Preferences tab.
There are two sets of unit types for volume: Liquid Volume and Gas Volume are used at the well and facility level, while Reservoir Volume and Reservoir Gas Volume are applied only to reservoir-level inputs and results. The reason is that, since reservoir figures are generally of an order of magnitude higher that those that apply to wells and facilities, it is generally more practical to have separate unit types for them. From the point of view of dimensional analysis, however, each unit type is fully compatible with its correlative (i.e., Reservoir Volume can be freely combined with Liquid Volume in FML expressions, etc.)
Creating and Editing User-Defined Units
PetroVR's built-in unit system covers all units and unit types usually found in the Oil & Gas industry. You can define and modify additional units (although not unit types) to meet specific requirements. The following options are available:
- Add: Create a new unit of the selected type.
- Edit: Edit the selected unit.
- Delete: Delete the selected unit.
- Replace with: Replace all uses of this unit in variables and FML expressions with another unit. Note that conversion factors will be applied.
When creating a new unit, select the unit type in the list before clicking on Add.
Notice that there are two kinds: simple and compound. Simple units are defined by a conversion factor relative to the base unit. Compound units are defined as the product or the ratio between two already existing units. This implies that in some cases you may need to create simple units first in order to define compound ones; e.g., if you need to define costs in terms of $/quarter, you must add a special time unit for quarter.
- To create a simple unit, enter a conversion factor relative to the unit base for the unit type selected.
- To create a compound unit, select the components whose product or ratio defines the new unit. In this case the system suggests a name based on the component names; you can rename the unit after selecting the components.
When a Money unit is created, PetroVR automatically generates a new compound unit for each already existing (compound) unit that includes the default money unit in its numerator. E.g., if you create a Money unit type for RBR, the unit list will immediately be populated with RBR/day, RBRMM/month, RBRM/m2, etc. since $/day, $MM/month, $M/m2 already exist in the system.
In some special cases compound units may be missing - e.g., when you open a project created by another user, or from an older version of PetroVR, where only the units actually used in the project are presented in the Unit Setup. In such cases you can right-click on the unit and use the option Add all related units to create the missing compound units.
If a project uses custom units but the unit file cannot be located, all units used in the project will be retrieved from the project and included in the system so that they become available for use in other variables. Note however, that units that have dependent units (e.g., Money units) will not populate all related units automatically. In such cases, use the Add all related units to create the missing dependent units.
When working with currency systems, you should use the Unit Setup to create just currencies and not magnitudes (e.g. $M, $MM). These are automatically created along with the unit, and even if they are not displayed in the unit lists, they will be recognized and correctly interpreted if used in FML expressions.